package com.aptech.yuanhuabao.api.test;

import com.aptech.yuanhuabao.api.ApiService;

import retrofit2.Retrofit;
import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory;
import retrofit2.converter.simplexml.SimpleXmlConverterFactory;

/**
 * des:
 * Created by zhh_li
 * on 2017/2/6.
 */

public class ApiXmlSimple {

    public static ApiService getApiService(String url) {

        Retrofit builder = new Retrofit.Builder()
                .baseUrl(url)
                .addConverterFactory(SimpleXmlConverterFactory.create())
                .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
                .build();

        ApiService apiInterface = builder.create(ApiService.class);
        return apiInterface;
    }
    public static ApiServiceCall getApiServiceCall(String url) {

        Retrofit builder = new Retrofit.Builder()
                .baseUrl(url)
                .addConverterFactory(SimpleXmlConverterFactory.create())
                .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
                .build();

        ApiServiceCall apiInterface = builder.create(ApiServiceCall.class);
        return apiInterface;
    }
}
